package org.example.model;

import lombok.*;

import java.util.List;

/**
 * @author shenguangyang
 */
@Getter
@Setter
@ToString
@AllArgsConstructor
@Builder
@NoArgsConstructor
@EqualsAndHashCode // 用于后期的去重使用
public class Author implements Comparable<Author> {
    private Long id;
    private String name;
    private String intro;
    private Integer age;
    private List<Book> books;

    @Override
    public int compareTo(Author o) {
        return this.age.compareTo(o.age);
    }
}
